home *** CD-ROM | disk | FTP | other *** search
/ 3D Game Programming All in One / 3D Game Programming All in One Disc.iso / 3D2E / RESOURCES / CH10 / creator / editor / editorRender.cs < prev    next >
Encoding:
Text File  |  2005-11-23  |  1.5 KB  |  41 lines

  1. //-----------------------------------------------------------------------------
  2. // Torque Game Engine 
  3. // Copyright (C) GarageGames.com, Inc.
  4. //-----------------------------------------------------------------------------
  5.  
  6. //------------------------------------------------------------------------------
  7. // Console onEditorRender functions:
  8. //------------------------------------------------------------------------------
  9. // Functions:
  10. //   - renderSphere([pos], [radius], <sphereLevel>);
  11. //   - renderCircle([pos], [normal], [radius], <segments>);
  12. //   - renderTriangle([pnt], [pnt], [pnt]);
  13. //   - renderLine([start], [end], <thickness>);
  14. //
  15. // Variables:
  16. //   - consoleFrameColor - line prims are rendered with this
  17. //   - consoleFillColor
  18. //   - consoleSphereLevel - level of polyhedron subdivision
  19. //   - consoleCircleSegments
  20. //   - consoleLineWidth
  21. //------------------------------------------------------------------------------
  22.  
  23. function SpawnSphere::onEditorRender(%this, %editor, %selected, %expanded)
  24. {
  25.    if(%selected $= "true")
  26.    {
  27.       %editor.consoleFrameColor = "255 0 0";
  28.       %editor.consoleFillColor = "0 15 0 15";
  29.       %editor.renderSphere(%this.getWorldBoxCenter(), %this.radius, 1);
  30.    }
  31. }
  32.  
  33. //function Item::onEditorRender(%this, %editor, %selected, %expanded)
  34. //{
  35. //   if(%this.getDataBlock().getName() $= "MineDeployed")
  36. //   {
  37. //      %editor.consoleFillColor = "0 0 0 0";
  38. //      %editor.consoleFrameColor = "255 0 0";
  39. //      %editor.renderSphere(%this.getWorldBoxCenter(), 6, 1);
  40. //   }
  41. //}